#include <cstdio>

int n, x[60004], v[60004];
const double eps = 1e-9;
double l, r;

double max(double x, double y) { return x > y ? x : y; }

double min(double x, double y) { return x < y ? x : y; }

bool check(double y) {
  double b = -2e9, t = 2e9;
  for (int i = 0; i < n; i++) {
    b = max(b, x[i] - v[i] * y);
    t = min(t, x[i] + v[i] * y);
  }
  return b <= t;
}

int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &x[i]);
  for (int i = 0; i < n; i++) scanf("%d", &v[i]);
  for (l = 0, r = 1e9; r - l > eps;) {
    double mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  printf("%.9lf\n", (l + r) / 2);
}
